Skip to content

Ensure waitForElement disconnects MutationObserver at the right time #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

grigasp
Copy link
Contributor

@grigasp grigasp commented Sep 17, 2018

What: #99 waitForElement gets into infinite setTimeout loop

Why: without the change MutationObserver gets into infinite setTimeout loop

How: disconnect the MutationObserver from setImmediate callback to ensure we're not in MutationObserver's onMutate callback when disconnecting it.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, ok, I'm not sure exactly what's going on, but this checks out 👍 thanks for your help!

@kentcdodds kentcdodds merged commit a0436d4 into testing-library:master Sep 17, 2018
@kentcdodds
Copy link
Member

🎉 This PR is included in version 3.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants